<!DOCTYPE html>
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
   <link rel="StyleSheet" type="text/css" href="/tpa/admin.css" />
   <link rel="StyleSheet" type="text/css" href="/tpa/jquery-ui.css" />
   <script type="text/javascript" src="/lib/js/jquery.js"></script>
   <script type="text/javascript" src="/lib/js/jquery.ui.js"></script>
   <script type="text/javascript" src="/lib/js/meccano.js"></script>
   <script type="text/javascript">
   $(document).ready(function(){
      $('#tabedContent').tabs();
   });
   </script>
</head>
<body>
   <div id="tabedContent">
      <ul>
      {%foreach from=$TR->types item='type_title' key='type' name='i'%}
         <li><a href="#t_type_{%$type%}"><span>{%$type_title%}</span></a></li>
      {%/foreach%}
      </ul>


      {%foreach from=$TR->types item='type_title' key='type' name='i'%}
      <div id="t_type_{%$type%}">
         <form action="/admin/types.php" method="post">
            <input type="hidden" name="f[type]" value="{%$type%}" />
            <table border="0" cellspacing="0">
            {%assign var='types_exists' value=false%}
            {%foreach from=$data item='type_item'%}
               {%if $type_item.type eq $type%}
               {%assign var='types_exists' value=true%}
               <tr>
                  <td><input type="text" name="f[value][{%$type_item.id%}]" value="{%$type_item.name%}" style="width:200px;" /></td>
                  <td class="ct">{%if !$type_item.system%}<a href="#" onclick="DropTr(this); return false;"><img src="/tpa/img/16/delete.gif" width="16" height="16" alt="{%$TR->meccano->delete%}" /></a>{%/if%}</td>
               </tr>
               {%/if%}
            {%/foreach%}
            {%if $types_exists eq false%}
               <tr>
                  <td><input type="text" name="f[value][]" value="" style="width:200px;" /></td>
                  <td class="ct"><a href="#" onclick="DropTr(this); return false;"><img src="/tpa/img/16/delete.gif" width="16" height="16" alt="{%$TR->meccano->delete%}" /></a></td>
               </tr>
            {%/if%}
               <tr>
                  <td colspan="2" class="ct">
                     <input type="button" onclick="$('#t_type_{%$type%}').cloneTr();return false;" value="{%$TR->meccano->addtype%}" />
                     <input type="submit" name="commit" value="{%$TR->meccano->save%}" />
                  </td>
               </tr>
            </table>
         </form>
      </div>
      {%/foreach%}

   </div>
</body>
</html>
